package com.testspring.service;

import com.handspring.MyAutowired;
import com.handspring.MyComponent;
import com.handspring.MyInitializingBean;
import com.handspring.MyScope;

/**
 * @author: ztl
 * @date: 2024/04/17 22:23
 * @desc:
 */

@MyComponent("userService")
//@MyScope("prototype")
@MyScope("singleton")
public class UserService implements MyInitializingBean {

    /**
     * 在userService下Autowired一个OrderService，是用来模拟依赖注入的。
     */
    @MyAutowired
    private OrderService orderService;

    public void test(){
        System.out.println(orderService);
        System.out.println("userService test !!! ");
    }

    public void afterPropertiesSet() {
        System.out.println("user 方法进行初始化了哦。。。");
    }
}
